import request from '@/utils/request'

const api_name="/teacher"
export default {

    getList(page, limit, searchObj) {
        return request({
            url: `${api_name}/list/${page}/${limit}`,
            method: "post",
            data: searchObj

        })

    },
    //删除讲师
    deleteTeacherById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'delete'
        })
    },
    //添加讲师
   addTeacher(teacher){
    return request({
      url: `${api_name}`,
      method: 'post',
      data: teacher
    })
  },
    //根据id查询讲师  数据回显
    etTeacherInfo(id){
    return request({
      url: `${api_name}/${id}`,
      method: 'get'
    })
  },
  //修改讲师
    updateTeacher(teacher){
    return request({
      url: `${api_name}/${teacher.id}`,
      method: 'put',
      data: teacher
    })
  },
}
